<template>
    <div>
        <h1>入党申请书</h1>
        <ul>
            <li v-for="stu in appliers">{{ stu.name }}</li>
        </ul>
    </div>
</template>

<script>
import { ref, computed } from "vue"
export default {
    name: 'publicity',
    components: {

    },
    setup() {
        const students = [
            { name: "张三", isApply: true, is18: true },
            { name: "李四", isApply: true, is18: true },
            { name: "张六", isApply: true, is18: true },
            { name: "小花", isApply: true, is18: true },
            { name: "小帅", isApply: false, is18: true },
            { name: "花姑娘", isApply: true, is18: false },
            { name: "李晓", isApply: true, is18: true },
            { name: "旺六", isApply: true, is18: true },
        ]
        const appliers = computed(() => {
            console.log("计算属性触发")
            return students.filter(stu => stu.isApply & stu.is18)
        })

        return {
            students,
            appliers
        }
    }
}
</script>

